interface stationData {
  stationInfo: StationData
}

export const useStationsStore = defineStore('station-store', {
  state: (): stationData => ({
    stationInfo: {
      X: 0,
      Y: 0,
      Z: 0,
      Latitude: '',
      Longitude: '',
      Height: '',
      Receiver: {
        Name: '',
        SatelliteSystem: '',
        SerialNumber: '',
        FirmwareVersion: '',
        ElevCutoff: '',
        DateInstalled: ''
      },
      Antenna: {
        Name: '',
        Radome: '',
        SerialNumber: '',
        ARP: '',
        MarkerUp: '',
        MarkerNorth: '',
        MarkerEast: '',
        DateInstalled: ''
      },
      Clock: {
        Type: '',
        InputFrequency: '',
        EffectiveDates: ''
      }
    }
  }),
  getters: {
    allStations: (state) => state
  },
  actions: {
    setStationData(newData: StationData) {
      this.stationInfo = { ...newData }
    }
  },
  persist: {
    storage: localStorage
  }
})
